Generally, in PLC processing for mechanically controlling a machine with a control apparatus, a large scale PLC processing program is written in a PLC computing unit incorporated inside a main body of the control apparatus, and the program is successively executed from its header. Then, the PLC computing unit successively executes such operations as reading contents of the program, executing a computing operation specified by the program using a machine input signal as an input data, and outputting the computed result as a machine output signal. The PLC computing unit executes a command for a final step in the program, then returns to the header of the program, and executes again the PLC processing program, thus a series of operations as described above being executed repeatedly.
Now detailed description is made for an example based on the conventional technology with reference to FIG. 26 to FIG. 29. FIG. 26 is a block diagram showing general configuration of a numerical control apparatus (described as NC device hereinafter) using distributed remote IO units, FIG. 27 is a block diagram showing general configuration of the distributed remote IO unit, FIG. 28 is a block diagram showing a flow of data for PLC processing in the remote IO unit, and FIG. 29 is an explanatory view showing a state in which the PLC processing program is executed.
In the figures, the same reference numerals indicate the same sections or the corresponding sections, and designated at the reference numeral 1 is a main body of an NC unit, at 2 a remote IO unit, at 4a a servo amplifier, at 4b a spindle amplifier, at 5a a driving section comprising a servo motor and an encoder, at 5b a driving section comprising a spindle motor and an encoder, at 101 a CPU for controlling the entire NC device, at 102 a RAM as an operation area in which the processing of the CPU 101 is executed, at 103 a ROM in which a control program for the CPU 101 is stored, at 104 a RAM for storing the PLC processing program, at 105 a PLC computing unit for executing mechanical control, at 107 a remote IO communication control section for inputting/outputting machine signals through communication, at 108 a servo/spindle communication control section for communicating with the servo amplifier 4a and the spindle amplifier 4b, at 109 a remote IO communication line between the remote IO unit 2 and the remote IO communication control section 107, at 111 a driving section communication line between the servo amplifier 4a, the spindle amplifier 4b, and the servo/spindle communication control section 108, at 112 a internal bus inside the main body of the NC device, at 113 a bit RAM for storing data for input to and output from a machine, at 119 data inputted from the machine (Di data), and at 120 data outputted to the machine (Do data).
Also designated at the reference numeral 18 is an NC communication control apparatus executing data transaction with the remote IO communication control section 107, at 19 a machine input/output I/F section executing data transaction with a machine, at Di1 machine input data inputted from the machine to the machine input/output I/F section 19, at Do1 machine output data outputted from the machine input/output I/F section 19 to the machine, at Di2 machine input data inputted from the NC communication control section 18 to the remote IO communication control section 107, and at Do2 machine output data outputted from the remote IO communication control section 107 to the NC communication control section 18.
Next description is made for operations. A large scale program for the PLC processing shown in FIG. 29 is stored in the RAM 104, and when the CPU 101 gives a command for starting execution of this program to the PLC computing unit 105, the PLC computing unit successively executes sequential processing (a processing flow TF in which processing is started from step 0 up to step n and returns again to step 0) from the header (step 0) of the program as shown in FIG. 29. An input data in this case is the machine input data (Di data) 119 stored in the bit RAM 113, and a result of computing is written in the area mapped in the output data section of the bit RAM 113 as machine output data (Do data).
On the other hand, the remote IO communication control section 107 fetches, independently from the PLC processing in the PLC computing unit 105, thereinto a portion of the machine output data 120 on the bit RAM 113 in a specified cycle and converts the data to serial data (Do2) to transmit the serial data to the remote IO unit 2 via the remote IO communication line 109.
The remote IO unit 2 receives this serial data in the NC communication control section 18 thereof and outputs a signal (Do1) from the machine input/output I/F section 19 to a machine as machine output data. On the other hand, when the machine input/output I/F section 19 receives a signal (Di1) from the machine, the remote IO unit 2 converts this data to serial data in the NC communication control section 18 thereof, and transmits the data to the remote IO communication control section 107 via the remote IO communication line 109. Then the transmitted data is stored in the bit RAM 113 as machine input data (Di data).
As described above, the PLC computing unit 105 reads machine input data stored in the bit RAM 113 according to the program stored in the RAM 104, executes a computing operation, and writes a result of the computing operation in the bit RAM 113 as machine output data. On the other hand, transaction of machine input/output data is cyclically executed between the bit RAM 113 as well as remote IO communication control section 107 in the main body 1 of the NC device 1 and the remote IO unit 2 through communications. Then operations described above are repeatedly executed.
In the numerical control apparatus having a PLC computing unit based on the conventional technology, the PLC computing unit in the main body 1 of the NC device successively executes PLC processing according to a PLC processing program stored in the main body 1 of the NC device. However, in this PLC processing, the entire sequence of all the system operations has to be executed according to one program (normally, a cycle time (scan time) required for executing this sequence program is in a range from a couple of ms to tens of ms) even in a case where the CPU 101 either executes the processing with software or has a dedicated PLC computing unit, so that the processing speed becomes slower as a scale of the program becomes larger, and for this reason, a period of time required for scanning the program for the PLC processing becomes longer as the machine system becomes more complicated and the number of steps in a program increases.
For instance, in a program for executing an logical operation for data for mechanical contact points 1 and 2 inputted in block A in FIG. 29 and outputting a result of the logical operation as a signal 3, a processing cycle for executing this block A is decided by the number of steps for the whole PLC processing program. Namely, assuming that input for the mechanical contact point 1 is turned on in step 0 and input for the mechanical contact point 2 is turned on during execution of the processing in step 3, a signal indicating turn ON of input for this mechanical contact point 2 is detected after the PLC computing unit 105 executes a last step (step n) of the PLC processing program, returns again to the header of the program and executes the command for step 1, so that a response time until the signal 3 indicating a result of the logical operation is turned on is equivalent in the worst case to a scan time for the PLC processing program.
To reduce this scan time, it is required to improve the performance of the PLC operation itself for executing the PLC processing program, which makes the system very expensive.
An example of configuration of a PLC device for processing input/output signals requiring a high-speed processing is disclosed in Japanese Patent Laid-Open Publication No. SHO 64-44509, and the device disclosed herein comprises a module for processing signals each not requiring a high-speed processing and a module for processing signals each requiring a high-speed processing, and the modules can be selected according to a speed required for processing each signal. However, employment of the configuration described above makes the system configuration more complicated, reliability of the system lower, and more expensive.
Furthermore, in the system using distributed remote IO units, machine input data (Di2) is transferred to the main body 1 of the NC device through the remote IO communication line 109 each time, so that, even in a case where machine input data requiring a high-speed processing is generated (for instance, in a case where an output signal to stop the machine has to be transmitted according to the input signal from a limit switch), the processing can not be executed at a speed higher than a transferring speed to the main body 1 of the NC device, so that the machine may disadvantageously overrun before the stop signal is actually issued.